/**
 * \class GenBoolExp.h /GenProg/AbsSyn/GenExpClasses/GenBoolExp.h
 *
 *  \date 22 maj 2012
 *  \author ytc0039
 *  
 *  \brief 
 */

#ifndef GENBOOLEXP_H_
#define GENBOOLEXP_H_
#include <AbsSyn/BoolExp.h>

class GenBoolExp : public IGenExp
{
private:
	BoolExp::genBoolExpFun m_GenFun;
public:
	explicit GenBoolExp(BoolExp::genBoolExpFun genBoolFun):
	m_GenFun(genBoolFun)
	{

	}

	virtual AbsSyn::IExpPtr genExp(GenExp::GenExpPtr genExpPtr) const
	{
		return m_GenFun();
	}

	virtual int getExpNrArg() const
	{
		return 0;
	}

	/**
	 *  \brief Does the type match the expression
	 *
	 *  When the generator creates a new expression
	 *  it is necessary to know if the type matches
	 *  the choosen expression.
	 *
	 * @param type
	 * @return true if it matches
	 */
	virtual bool isTypeMatch(TypeEnum type) const{
		bool ret = false;
		if( type == TypeEnum::BoolT)
		{
			ret = true;
		}

		return ret;
	}
};

#endif /* GENBOOLEXP_H_ */
